<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'invsubcategories-form',
	'enableAjaxValidation'=>false,
        'htmlOptions'=>array(
            'enctype'=>'multipart/form-data'
        )
)); ?>

	<p class="note">Fields with <span class="required">*</span> are required.</p>

	<?php echo $form->errorSummary($model); ?>
        <?php echo $form->errorSummary($model); ?>
        <?php if(isset($model->image) && $model->image!=NULL):?>
            <img src="<?=getImage($model->image,'images/content/subcategories/',250,250);?>"/>
        <?php endif?>
        <div class="row">
            
		<?php echo $form->labelEx($model,'image'); ?>
            
		<?php echo $form->fileField($model,'file'); ?>
            <div class="model-data">
                <?=$model->image;?>
            </div>
		<?php echo $form->error($model,'file'); ?>
	</div>
            
	<div class="row">
		<?php echo $form->labelEx($model,'category'); ?>
            <?php if($model->isNewRecord):?>
                <?php echo $model->category;?>
                <?php echo $form->hiddenField($model,'category');?>
            <?php else:?>
                <?php echo $form->dropDownList($model,'category',$model->getCategoryList()); ?>
            <?php endif?>
		<?php echo $form->error($model,'category'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'subcategory'); ?>
		<?php echo $form->textField($model,'subcategory',array('size'=>60,'maxlength'=>75)); ?>
		<?php echo $form->error($model,'subcategory'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'applymarkup'); ?>
		<?php echo $form->dropDownList($model,'applymarkup',$model->getApplyMakupList()); ?>
		<?php echo $form->error($model,'applymarkup'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'markupcode'); ?>
		<?php echo $form->textField($model,'markupcode'); ?>
		<?php echo $form->error($model,'markupcode'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'pricebook'); ?>
		<?php echo $form->textField($model,'pricebook',array('size'=>4,'maxlength'=>4)); ?>
		<?php echo $form->error($model,'pricebook'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'status'); ?>
		<?php echo $form->dropDownList($model,'status',$model->getStatusList()); ?>
		<?php echo $form->error($model,'status'); ?>
	</div>

	<div class="row_buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->